package com.steven.treatment_case.breadCast;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.steven.treatment_case.activity.VideoActivity;

public class CallReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        // 拨打方username
        String from = intent.getStringExtra("from");
        // call type
        String type = intent.getStringExtra("type");
        //跳转到通话页面
        context.startActivity(new Intent(context, VideoActivity.class)
                .putExtra("userName", from)
                .putExtra("isComingIn", false)
                .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
    }
}
